package com.iv.durian.cloud.dao;

import com.iv.durian.cloud.User;
import com.iv.durian.cloud.dao.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class UserDao {

    @Autowired
    private UserMapper userMapper;

    public User get(Integer id, String mobile,  String email,String ticket){
        return userMapper.get(id,mobile,email,ticket);
    }

    public int add( User user){
        return userMapper.add(user);
    }

    public int updatePassword(int id,String password){
        return userMapper.updatePassword(id,password);
    }

    public int updateStatus(int id, int status){
        return userMapper.updateStatus(id,status);
    }

    public List<User> list(Integer status, int offset,  int limit){
        return userMapper.list(status,offset,limit);
    }

    public int count(Integer status){
        return userMapper.count(status);
    }

    public int updateTicket( int id, String ticket,long expire){
        return userMapper.updateTicket(id,ticket,expire);
    }

    public int cleanTicket( int id){
        return userMapper.cleanTicket(id);
    }
}
